﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.InterceptionExtension;
using Microsoft.Practices.EnterpriseLibrary.PolicyInjection.Configuration;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;

namespace PolicyInjectionExtension
{
    public class ConfigurationPolicyInjectionHelper:PolicyInjectionHelper 
    {
        public ConfigurationPolicyInjectionHelper(IConfigurationSource configurationSource)
            :base()
        {  
            PolicyInjectionSettings settings
                = (PolicyInjectionSettings)configurationSource.GetSection(PolicyInjectionSettings.SectionName);
            if (settings != null)
            {
                settings.ConfigureContainer(container, configurationSource);
            }
        }
    }
}
